package com.facedemo;

import android.app.Application;
import android.os.Environment;

import com.facedemo.bean.DCamera;
import com.facedemo.db.utils.DaoManager;
import com.facedemo.face.FaceConfig;
import com.facedemo.utils.FastYUVtoRGB;

public class MyApplication extends Application {
    private static MyApplication instance;
    public static MyApplication getInstance() {
        return instance;
    }

    public static final String APP_NAME = "FaceDemo";

    //照片存储地址
    public static final String DIR_PATH_M = Environment.getExternalStorageDirectory().getPath() + "/"+APP_NAME;
    public static final String DIR_PATH = DIR_PATH_M + "/face_photo/";//人脸图片路径

    public static DCamera dCamera;//摄像头配置
    public static FaceConfig faceConfig;//人脸识别配置

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        dCamera = new DCamera();
        faceConfig = new FaceConfig();
        FastYUVtoRGB.getInstance().initContext(getApplicationContext());
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        DaoManager.getInstance().closeConnection();
    }
}
